package com.baigt.juc.base;

/**
 * 类功能描述:
 * 常见的使用线程的方式？
 * 有什么区别？
 * <p>
 * GOF？
 * template?category?
 * run  or  runnable
 *
 * @author baigt
 * @version V1.0
 * @since 2019-10-15 15:47
 */
public class ThreadRun00 {
    public static void main(String[] args) {

    }

    //使用方式一
    public static void usedWay01() {
        Thread thread = new Thread() {
            @Override
            public void run() {
                // something here
            }
        };
        thread.start();
    }

    //使用方式二
    public static void usedWay02() {
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                // something here
            }
        };
        Thread thread = new Thread(runnable);
        thread.start();
    }
}
